
package com.tenentia.pcmps.swm.data.util;

import java.io.InputStream;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

/**
 * 
 * @author tEnEntia, S.L.N.E.
 * 
 */
public class IBatisUtilities {

	private static SqlMapClient sqlMapClient;

	private IBatisUtilities() {

		super();
	}

	public static SqlMapClient getSqlMapClient() {

		if (null == sqlMapClient) {
			InputStream inputStream = IBatisUtilities.class.getClassLoader().getResourceAsStream("ibatis-config.xml");
			sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(inputStream);
		}

		return sqlMapClient;
	}

}
